import { domainService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";
import { Service } from '~/core/service'

export class CustomerGroupManageService extends Service {

  @Inject(NetService)
  private netService: NetService

  /**
   * 新增标签
   */
  public addTag(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.addTag,
      data,
      loading: true
    })
  }
  /** 
   * 查询
   */
  public findAllTags(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllTags,
      data,
      page
    })
  }
  /**
   * 修改
   */
  public modifyTag(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.modifyTag,
      data,
      loading: true
    })
  }
  /**
   * 停用/启用
   */
  public updateStatus(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.updateStatus,
      data,
      loading: true
    })
  }

  public getEffectTags(data?) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getEffectTags,
      data
    })
  }

  public findAllCaseTags(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllCaseTags,
      data,
      page
    })
  }


  public findAllPersonalTags(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllPersonalTags,
      data,
      page
    })
  }

  public findAllCaseTagAdjustApply(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllCaseTagAdjustApply,
      data,
      page
    })
  }

  public findAllTypes(data, page, sort) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllTypes,
      data,
      page,
      sort
    })
  }

  public addAdjustType(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.addAdjustType,
      data,
      loading: true
    })
  }

  public modifyAdjustType(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.modifyAdjustType,
      data
    })
  }
  public caseUpdateStatus(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.caseUpdateStatus,
      data,
      loading: true
    })
  }

  public findCaseAdjustTypeLogs(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findCaseAdjustTypeLogs,
      data,
      page
    })
  }
  public getApplyById(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getApplyById,
      data,
    })
  }

  public findAllApply(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllApply,
      data,
      page
    })
  }

  public findAllPersonalTagAdjustApply(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllPersonalTagAdjustApply,
      data,
      page
    })
  }

  public getPersonalInfo(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getPersonalInfo,
      data
    })
  }

  public getEffectTypes() {
    return this.netService.send({
      server: domainService.customerGroupManageController.getEffectTypes
    })
  }
  public singleAdjustment(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.singleAdjustment,
      data,
      loading: true
    })
  }

  public getPersonalTags(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getPersonalTags,
      data
    })
  }

  public personalSingleAdjustment(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.personalSingleAdjustment,
      data,
      loading: true
    })
  }

  public caseSingleAdjustment(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.caseSingleAdjustment,
      data,
      loading: true
    })
  }

  public getCaseTags(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getCaseTags,
      data
    })
  }

  public downloadCaseTemplate() {
    return this.netService.send({
      server: domainService.customerGroupManageController.downloadCaseTemplate,
    })
  }

  public downloadPersonalTemplate() {
    return this.netService.send({
      server: domainService.customerGroupManageController.downloadPersonalTemplate,
    })
  }

  public caseTagBatchAdjust(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.caseTagBatchAdjust,
      data
    })
  }

  public personalTagBatchAdjust(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.personalTagBatchAdjust,
      data
    })
  }
  // 通过ID获取账户案件信息
  public getTagApplyById(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getApplyById,
      data,
    })
  }

  /**
   * 账户/客户标签轨迹查询
   */
  public findAllTagLogs(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.findAllTagLogs,
      data,
      page
    })
  }
  public getTagApplyByTagId(data, page) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getTagApplyByTagId,
      data,
      page
    })
  }
  public getTagCaseApplyRecordHistory(data) {
    return this.netService.send({
      server: domainService.customerGroupManageController.getTagCaseApplyRecordHistory,
      data
    })
  }




}

